package com.hujiang.basic.search.common.converter.req;

import org.elasticsearch.action.bulk.BulkRequestBuilder;

import com.alibaba.fastjson.JSONObject;
import com.hujiang.basic.search.common.converter.Converter;

import java.util.Map;

public abstract class BulkRequestConverter<I> implements Converter<I, BulkRequestBuilder> {

    protected String extractId(JSONObject json){
        String id = null;
        if (json.containsKey("_id")) {
            id = json.getString("_id");
            json.remove("_id");
        }
        return id;
    }
}
